﻿<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../lib/html5.js"></script>
<script type="text/javascript" src="../lib/respond.min.js"></script>
<script type="text/javascript" src="../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
<script type="text/javascript" src="../lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>贴码</title>
    <style type="text/css">
        .auto-style1 {
            width: 40px;
        }
    </style>
</head>
<body>
    <div class="pd-5">
        <div class="text-c" id="findfdiv">
            <div class="formControls col-2">
                <span class="select-box">
                    <select class="select" size="1" name="findtaskfromorgid_dn" id="findtaskfromorgid_dn">
                    </select></span>
            </div>
            <!--<div class="col-2">
                <input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" placeholder="采收时间" id="findtaskworktime_timese" name="findtaskworktime_timese" class="input-text Wdate">
            </div>-->
            <div class="col-2">
                <input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" placeholder="登记时间" id="findTHcRainDHdataaddtime_timese" name="findTHcRainDHdataaddtime_timese" class="input-text Wdate">
            </div>
            <div class="col-1">
                <input type="text" class="input-text" placeholder="品种" id="findproductname" name="findproductname">
            </div>
            <div class="col-1">
                <input type="text" class="input-text" placeholder="地块" id="finddkname" name="finddkname">
            </div>
            <div class="col-1">
                <input type="text" class="input-text" placeholder="开始编号" id="findstartcode" name="findstartcode">
            </div>
            <div class="col-1">
                <input type="text" class="input-text" placeholder="结束编号" id="findendcode" name="findendcode">
            </div>
            <button onclick="findreolad()" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 查询</button>
        </div>
     
        <div class="cl pd-5 bg-1 bk-gray mt-5">
            <span class="l">
                <a href="javascript:;" onclick="toolDelete()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 删除</a>
                <a href="javascript:;" onclick="toolUpdate()" class="btn btn-secondary radius"><i class="Hui-iconfont">&#xe6df;</i> 修改</a>
                <a href="javascript:;" onclick="toolAdd()" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加-按入库</a>
                <a href="javascript:;" onclick="toolAdd('', 'processstoreCodeSp-jdae.html?action=add', '', '')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 帖码登录</a>
                <!--                <a href="javascript:;" onclick="toolAdd()" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加-基地发货</a>-->
            </span>
            <span class="l">
                <button onclick="toolExport('hcvueapp')" class="btn btn-secondary  round" id="Button1" name=""><i class="Hui-iconfont">&#xe644;</i>导出</button></span>
            <span class="r">操作提示：贴码记录<strong>^_^</strong> </span>
        </div>
        <div class="mt-5 ml-20" id="hcvueapp">
            <table class="table table-border table-bordered table-striped table-hover" border="1" bordercolor="#000000" cellspacing="0" id="tablelist" width="100%">
                <thead>
                    <tr class="text-c">
                        <th width="30"><a id="hcmtable_sall" onclick="hcmtable_sall();" href="javascript:;" title="全选反选"><i class="Hui-iconfont">&#xe608;全</i></a></th>
                        <th>类型</th> <th>登记日期</th>
                        <th>入库日期</th>
                        <th>基地名称</th>
                        <th>任务</th>
                        <th>地块</th>
                        <th>品种</th>
                        <th>状态</th>
                        <th>开始编号</th>
                        <th>结束编号</th>
                        <th>数量</th>
                        <!--  <th>时间</th>-->
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
    </div>
    <script src="../hcjsui/Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../lib/layer/1.9.3/layer.js"></script>
    <script type="text/javascript" src="../lib/laypage/1.2/laypage.js"></script>
    <script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../lib/datatables/1.10.0/jtable.js"></script>
    <script src="../hcjsui/js/_Define.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/hcui.js"></script>
    <script type="text/javascript" src="../js/hcui_list.js"></script>
    <script type="text/javascript">
        $("#findTHcRainDHdataaddtime_timese").val(new Date().Format("yyyy-MM-dd"));//开始时间
        function toolExport() {
            var whereadd = " 1=1 ";
            $("#findfdiv").find("input[type='text']").each(function () {
                //后端导出 
                var fieldinfo = this.id;
                if ($("#" + this.id).val() && fieldinfo.indexOf("find") >= 0) {
                    var fieldvalue = $("#" + this.id).val();
                    fieldinfo = fieldinfo.replace("find", "");
                    if (fieldinfo.endsWith("_l"))
                    { whereadd += " and " + fieldinfo.replace("_l", "") + " like '%" + fieldvalue + "%'"; }
                    else if (fieldinfo.endsWith("_d"))
                    { whereadd += " and " + fieldinfo.replace("_d", "") + " = '" + fieldvalue + "'"; }
                    else if (fieldinfo.endsWith("_dn"))
                    { whereadd += " and " + fieldinfo.replace("_dn", "") + " = " + fieldvalue + ""; }
                    else if (fieldinfo.endsWith("_time")) {
                        whereadd += " and " + fieldinfo.replace("_time", "") + " = '" + fieldvalue + "'";
                    }
                    else if (fieldinfo.endsWith("_times")) {
                        whereadd += " and " + fieldinfo.replace("_times", "") + " >= '" + fieldvalue + "'";
                    }
                    else if (fieldinfo.endsWith("_timee")) {
                        whereadd += " and " + fieldinfo.replace("_timee", "") + " <= '" + fieldvalue + "'";
                    }
                    else if (fieldinfo.endsWith("_timese")) {
                        whereadd += " and " + fieldinfo.replace("_timese", "") + " >= '" + fieldvalue + " 00:00:00'";
                        whereadd += " and " + fieldinfo.replace("_timese", "") + " <= '" + fieldvalue + " 23:59:59'";
                    }
                    else {
                        whereadd += " and " + fieldinfo + " like '%" + fieldvalue + "%'";
                    }


                    //whereadd += " and " + idname.replace("find", "") + "='" + $("#" + this.id).val() + "'";
                }
            });
            hcdoExport("inouttype 类型,dataaddtime 登记时间,taskworktime 采收时间,taskfromorgname 基地名称,taskno 任务编号,dkname 地块 ,productname 品种,startcode 开始编号 ,endcode 结束编号,codecount 数量 ",
                "hsc_task_process_workok_code as T", whereadd, "", "", "csgetpc desc");
        }

        $(function () {
            spsetBaseNoBt("hsc_task_process_workok_code", "id", "hsc_task_process_workok_code as T", "*", "#tablelist", "processstoreCodeSp", "贴码记录", "processstoreCodeSp");
            //基地
            hcdoselbyPost("BranchID as id,BranchName as name", "mrbranch", "type='本部'", "", "", "id", function (data) { SetSelectWithArrayIdName("#findtaskfromorgid_dn", data); });
            hcmtable = $("#tablelist").DataTable({
                "serverSide": true,//服务端处理分页 无法使用当前查找
                "bFilter": false,  //是否使用内置的过滤功能
                "bInfo": true, "fnDrawCallback": function () { dTappendSkipPage(); },
                "bLengthChange": true, //改变每页显示数据数量
                "ajax": {
                    "type": "POST",
                    "url": spselUrl(" ") + "&sporderby=csgetpc desc ",
                    "data": function (d) {
                        $("#findfdiv").find("input[type='text']").each(function () {
                            d[this.id] = $(this).val();
                        });
                        $("#findfdiv").find("select").each(function () {
                            d[this.id] = $(this).val();
                        });
                    }
                },
                // "order": [[1, "asc"]],//默认第几个排序
                aLengthMenu: [100, 500, 1000, 10000],
                "columns": [
                   { "data": "rowhcindex" }, { "data": "inouttype" }, { "data": "dataaddtime" }, { "data": "taskworktime" }, { "data": "taskfromorgname" }, { "data": "taskno" },
                { "data": "dkname" },
                { "data": "productname" }, { "data": "productstate" },
                { "data": "startcode" }, { "data": "endcode" }, { "data": "codecount" }, { "data": "id" }
                ],

                "columnDefs": [
                   // 操作列
                    {
                        "targets": [12],
                        "render": function (data, type, row) {
                            return "<a style=\"text-decoration:none\" class=\"ml-5\" onClick=\"toolUpdateById('" + data + "')\" href=\"javascript:;\" title=\"编辑\"><i class=\"Hui-iconfont\">&#xe6df;编辑</i></a> " +
                                   "<a style=\"text-decoration:none\" class=\"ml-5\" onClick=\"toolDelete('" + data + "')\"     href=\"javascript:;\" title=\"删除\"><i class=\"Hui-iconfont\">&#xe6e2;删除</i></a>" +
                            "<a style=\"text-decoration:none\" onClick=\"toolAdd('', 'processstoreCodeSp-print.html?code=" + row.startcode + "', '', '')\" href=\"javascript:;\" title=\"打印\">打印</a>";
                        }
                    },
                    //不排序
                   {
                       "orderable": false,
                       "targets": [0]
                   }

                ]
            });
        });
    </script>
</body>
</html>
